package com.erp.framework.exceptions;

import com.erp.framework.model.pk.SimpleBasePk;

/**
 * @author Apex-pro
 * @version				$Revision: 1.1 $ $Date: 2006/04/12 08:25:23 $

 * ReferentialException is a exception class.
 * 
 */
public class ReferentialException extends ProcessingException {

	/**
	 * target.
	 *
	 */
	protected SimpleBasePk target = null;

	/**
	 * entity.
	 *
	 */
	protected String entity = null;

	/**
	 * referenceEntity.
	 *
	 */
	protected String referenceEntity = null;

	/**
	 * Constructs an empty CheckFieldLengthException object
	 * 
	 */
	public ReferentialException() {
	}

	/**
	 * Constructs a ReferentialException object with specific primary key, entity and referenceEntity.
	 * 
	 * @param entity			Entity
	 * @param target			Primary Key object
	 * @param referenceEntity	Reference Entity
	 * 
	 */
	public ReferentialException(String entity, SimpleBasePk target, String referenceEntity) {
		this.entity = entity;
		this.target = target;
		this.referenceEntity = referenceEntity;
	}

	/**
	 * Constructs a ReferentialException object with an error message
	 * 
	 * @param msg		error message for this exception
	 * 
	 */
	public ReferentialException(String msg) {
		super(msg);
	}

	/**
	 * Returns an entity
	 * 
	 * @return				an entity string.
	 * 
	 */
	public String getEntity() {
		return entity;
	}

	/**
	 * Returns the primary key object.
	 * 
	 * @return				A primary key object.
	 * 
	 */
	public SimpleBasePk getTarget() {
		return target;
	}

	/**
	 * Returns the reference entity.
	 * 
	 * @return				the reference entity.
	 * 
	 */
	public String getReferenceEntity() {
		return referenceEntity;
	}


}


